package com.shsh.safemanage.util;

import java.util.List;

import com.shsh.safemanage.model.ProblemHSECategory;

public class ActionUtil {
	public static ProblemHSECategory problemHSECategoryExistsIn(Long problemID, Long hseCategoryID, int hseCategoryType, List<ProblemHSECategory> problemHSECategoryList) {
		if (problemHSECategoryList == null) {
			return null;
		}
		
		for (ProblemHSECategory problemHSECategory : problemHSECategoryList) {
			if (problemHSECategory.getProblemID().equals(problemID) && problemHSECategory.getHseCategoryID().equals(hseCategoryID) 
					&& hseCategoryType == problemHSECategory.getHseCategoryType()) {
				return problemHSECategory;
			}
		}
		
		return null;
	}
}
